/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Damian
 */
@Embeddable
public class CompanyPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_COMPANY")
    private int idCompany;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_BUSINESSMAN")
    private int idBusinessman;

    public CompanyPK() {
    }

    public CompanyPK(int idCompany, int idBusinessman) {
        this.idCompany = idCompany;
        this.idBusinessman = idBusinessman;
    }

    public int getIdCompany() {
        return idCompany;
    }

    public void setIdCompany(int idCompany) {
        this.idCompany = idCompany;
    }

    public int getIdBusinessman() {
        return idBusinessman;
    }

    public void setIdBusinessman(int idBusinessman) {
        this.idBusinessman = idBusinessman;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCompany;
        hash += (int) idBusinessman;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompanyPK)) {
            return false;
        }
        CompanyPK other = (CompanyPK) object;
        if (this.idCompany != other.idCompany) {
            return false;
        }
        if (this.idBusinessman != other.idBusinessman) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.CompanyPK[ idCompany=" + idCompany + ", idBusinessman=" + idBusinessman + " ]";
    }
    
}
